<template>
	
	 <view>
		 

		 	<u-popup v-model="iscouponPoup" mode="center" border-radius="40" >
		 			<view class="content">
						<view class="titlebg">
							<view style="font-size: 80rpx;">领券啦</view>
							<view style="font-size: 32rpx;">我们为您准备了代金抵扣券哦~</view>
						</view>
						
						<view class="bg">
							<view v-for="(item,index) in coupondList" :key="index" class="coupondList">
							    <view class="price">￥{{item.price}}</view>
								 <view class="des">{{item.des}}</view>
							</view>
						</view>
						
					</view>	
					<u-button shape="circle"  :custom-style="{background:'#FF6450',color:'#fff',marginTop:'40rpx',position: 'fixed',bottom:'100rpx',width:'500rpx'}" @click="ok">立即领取</u-button>
		 	</u-popup>
		   
	 </view>
 
</template>

<script>
	export default{
		// props:{
		// 	iscouponPoup:{
		// 	   type:Boolean,
		// 		   default:false,
		// 	}
		// },
		data(){
			return{
				iscouponPoup:false,
				coupondList:[{
					price:"5.00",
					des:"购买代金券时可抵扣5.00"
				},{
					price:"5.00",
					des:"购买代金券时可抵扣5.00"
				}]
			
			}
		},
		methods:{
			ok(){	
				this.$u.post('/api/user/getCoupon', {
				
					}, {}).then(res => {
						console.log(111)
						this.iscouponPoup=false
						let _userInfo = uni.getStorageSync('userInfo')
						_userInfo.first = 0
						uni.setStorageSync('userInfo',_userInfo)
						  this.$store.commit("adduser")
						  
						  uni.navigateTo({
						  	url:"/pages/buyCoupond/index"
						  })
					}).catch(err => {})
			}
			
		}
	}
</script>

<style lang="scss">
	.content{
		width: 500rpx;	

	
		.titlebg{
			background: #FF6450;
			width: 100%;
			color: #FFFFFF;
			text-align: center;
				padding: 20rpx;
		}
	}
	
	.bg{
		 background-image: url(../static/lihua.png);
		 width: 500rpx;
		 height: auto;
		 padding: 20rpx 40rpx;
		  background-size: cover;
		 .coupondList{
			 background-image: url(../static/Subtract.png);
			 width: 355rpx;
			 height: 172rpx;
			 background-size: cover;
			 margin: 20rpx auto 20rpx auto;
			 text-align: center;
			 
			 .price{
				 color: #FFFFFF;
				 font-size: 60rpx;
				 padding: 20rpx 0;
			 }
			 .des{
				 color: #FFFFFF;
				 font-size: 20rpx;
			 }
		
		 }
	}
</style>
